home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Demos / A.D. Software / OOFILE 1.3b4d6.sit / OOFILE 1.3b4d6 / MacCodeWarriorDemo1.3b4d6 / docs / samples / ooftst21.cpp < prev    next >
MacBinary  |  1997-03-18  |  5.3 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Mon Mar 17 20:06:41 1997, modified Mon Mar 17 20:06:41 1997, creator 'CWIE', type ASCII, 4725 bytes "ooftst21.cpp" , at 0x12f5 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 6f 6f 66 74 73 74 | 32 31 2e 63 70 70 00 00 |..ooftst|21.cpp..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 12 75 00 | 00 01 9a af 53 9b 21 af |......u.|....S.!.|
|00000060| 53 9b 21 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |S.!.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 45 a6 00 00 |........|....E...|
|00000080| 2f 2f 20 43 6f 70 79 72 | 69 67 68 74 20 31 39 39 |// Copyr|ight 199|
|00000090| 36 20 41 2e 44 2e 20 53 | 6f 66 74 77 61 72 65 2e |6 A.D. S|oftware.|
|000000a0| 20 41 6c 6c 20 52 69 67 | 68 74 73 20 52 65 73 65 | All Rig|hts Rese|
|000000b0| 72 76 65 64 0d 0d 2f 2f | 20 4f 4f 46 54 45 53 54 |rved..//| OOFTEST|
|000000c0| 32 31 0d 0d 2f 2f 20 54 | 68 69 73 20 73 61 6d 70 |21..// T|his samp|
|000000d0| 6c 65 20 74 65 73 74 73 | 20 74 68 65 20 6d 75 6c |le tests| the mul|
|000000e0| 74 69 70 6c 65 20 66 69 | 65 6c 64 20 73 6f 72 74 |tiple fi|eld sort|
|000000f0| 69 6e 67 2e 0d 0d 2f 2f | 20 53 69 6d 70 6c 65 20 |ing...//| Simple |
|00000100| 73 74 72 65 61 6d 20 49 | 2f 4f 20 69 73 20 75 73 |stream I|/O is us|
|00000110| 65 64 20 74 6f 20 69 6e | 74 65 72 61 63 74 20 77 |ed to in|teract w|
|00000120| 69 74 68 20 74 68 65 20 | 75 73 65 72 2e 0d 23 69 |ith the |user..#i|
|00000130| 6e 63 6c 75 64 65 20 22 | 6f 6f 66 69 6c 65 2e 68 |nclude "|oofile.h|
|00000140| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 6f 6f 66 69 |".#inclu|de "oofi|
|00000150| 6f 73 2e 68 22 0d 0d 44 | 45 43 4c 41 52 45 5f 43 |os.h"..D|ECLARE_C|
|00000160| 4c 41 53 53 28 64 62 54 | 65 73 74 32 31 29 0d 09 |LASS(dbT|est21)..|
|00000170| 64 62 43 68 61 72 09 09 | 66 31 3b 0d 09 64 62 55 |dbChar..|f1;..dbU|
|00000180| 6c 6f 6e 67 09 09 66 32 | 3b 0d 09 64 62 52 65 61 |long..f2|;..dbRea|
|00000190| 6c 09 09 66 33 3b 20 20 | 0d 09 73 74 61 74 69 63 |l..f3; |..static|
|000001a0| 20 64 62 53 6f 72 74 65 | 72 20 73 6f 72 74 31 32 | dbSorte|r sort12|
|000001b0| 33 3b 0d 09 0d 09 64 62 | 54 65 73 74 32 31 28 29 |3;....db|Test21()|
|000001c0| 20 3a 20 66 31 28 32 30 | 2c 20 22 46 31 22 2c 20 | : f1(20|, "F1", |
|000001d0| 6b 49 6e 64 65 78 65 64 | 29 2c 0d 09 09 09 09 66 |kIndexed|),.....f|
|000001e0| 32 28 22 46 32 22 2c 20 | 6b 49 6e 64 65 78 65 64 |2("F2", |kIndexed|
|000001f0| 29 2c 0d 09 09 09 09 66 | 33 28 22 46 33 22 2c 20 |),.....f|3("F3", |
|00000200| 6b 49 6e 64 65 78 65 64 | 29 0d 7b 7d 3b 0d 09 0d |kIndexed|).{};...|
|00000210| 2f 2f 20 6d 79 20 6f 77 | 6e 20 64 61 74 61 20 65 |// my ow|n data e|
|00000220| 6e 74 72 79 20 70 72 6f | 63 65 64 75 72 65 73 0d |ntry pro|cedures.|
|00000230| 09 76 6f 69 64 20 41 64 | 64 28 63 6f 6e 73 74 20 |.void Ad|d(const |
|00000240| 63 68 61 72 20 2a 74 66 | 31 2c 63 6f 6e 73 74 20 |char *tf|1,const |
|00000250| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 20 74 66 |unsigned| long tf|
|00000260| 32 2c 63 6f 6e 73 74 20 | 64 6f 75 62 6c 65 20 74 |2,const |double t|
|00000270| 66 33 29 3b 0d 09 76 6f | 69 64 20 41 64 64 54 65 |f3);..vo|id AddTe|
|00000280| 73 74 44 61 74 61 28 29 | 3b 0d 7d 3b 0d 0d 0d 76 |stData()|;.};...v|
|00000290| 6f 69 64 20 64 62 54 65 | 73 74 32 31 3a 3a 41 64 |oid dbTe|st21::Ad|
|000002a0| 64 28 63 6f 6e 73 74 20 | 63 68 61 72 20 2a 74 66 |d(const |char *tf|
|000002b0| 31 2c 63 6f 6e 73 74 20 | 75 6e 73 69 67 6e 65 64 |1,const |unsigned|
|000002c0| 20 6c 6f 6e 67 20 74 66 | 32 2c 63 6f 6e 73 74 20 | long tf|2,const |
|000002d0| 64 6f 75 62 6c 65 20 74 | 66 33 29 0d 7b 0d 09 6e |double t|f3).{..n|
|000002e0| 65 77 52 65 63 6f 72 64 | 28 29 3b 0d 09 66 31 3d |ewRecord|();..f1=|
|000002f0| 74 66 31 3b 0d 09 66 32 | 3d 74 66 32 3b 0d 09 66 |tf1;..f2|=tf2;..f|
|00000300| 33 3d 74 66 33 3b 0d 09 | 73 61 76 65 52 65 63 6f |3=tf3;..|saveReco|
|00000310| 72 64 28 29 3b 0d 7d 0d | 0d 0d 76 6f 69 64 20 64 |rd();.}.|..void d|
|00000320| 62 54 65 73 74 32 31 3a | 3a 41 64 64 54 65 73 74 |bTest21:|:AddTest|
|00000330| 44 61 74 61 28 29 0d 7b | 0d 09 41 64 64 28 22 44 |Data().{|..Add("D|
|00000340| 65 6e 74 6f 6e 22 2c 32 | 30 30 30 2c 33 2e 35 29 |enton",2|000,3.5)|
|00000350| 3b 0d 09 41 64 64 28 22 | 54 61 79 6c 6f 72 22 2c |;..Add("|Taylor",|
|00000360| 32 30 30 30 2c 34 2e 35 | 29 3b 0d 09 41 64 64 28 |2000,4.5|);..Add(|
|00000370| 22 54 61 79 6c 6f 72 22 | 2c 33 30 30 30 2c 35 2e |"Taylor"|,3000,5.|
|00000380| 35 29 3b 0d 09 41 64 64 | 28 22 54 61 79 6c 6f 72 |5);..Add|("Taylor|
|00000390| 22 2c 32 30 30 30 2c 33 | 2e 35 29 3b 0d 09 41 64 |",2000,3|.5);..Ad|
|000003a0| 64 28 22 44 65 6e 74 6f | 6e 22 2c 31 30 30 30 2c |d("Dento|n",1000,|
|000003b0| 31 2e 35 29 3b 0d 09 41 | 64 64 28 22 55 6e 64 65 |1.5);..A|dd("Unde|
|000003c0| 72 77 6f 6f 64 22 2c 31 | 30 30 30 2c 31 2e 35 29 |rwood",1|000,1.5)|
|000003d0| 3b 0d 09 41 64 64 28 22 | 5a 61 70 68 6f 64 22 2c |;..Add("|Zaphod",|
|000003e0| 35 30 30 30 2c 35 2e 35 | 29 3b 0d 7d 0d 0d 0d 0d |5000,5.5|);.}....|
|000003f0| 2f 2f 20 74 65 73 74 20 | 73 6f 6d 65 20 73 70 65 |// test |some spe|
|00000400| 63 69 66 69 63 20 73 6f | 72 74 20 62 75 67 73 20 |cific so|rt bugs |
|00000410| 72 65 70 6f 72 74 65 64 | 20 62 79 20 4c 69 61 6d |reported| by Liam|
|00000420| 0d 63 6c 61 73 73 20 64 | 62 41 72 63 68 69 76 65 |.class d|bArchive|
|00000430| 20 3a 20 70 75 62 6c 69 | 63 20 64 62 54 61 62 6c | : publi|c dbTabl|
|00000440| 65 20 7b 20 0d 0d 09 4f | 4f 46 49 4c 45 5f 4d 45 |e { ...O|OFILE_ME|
|00000450| 54 48 4f 44 53 28 64 62 | 41 72 63 68 69 76 65 29 |THODS(db|Archive)|
|00000460| 20 20 0d 0d 70 75 62 6c | 69 63 3a 20 20 2f 2f 20 | ..publ|ic: // |
|00000470| 74 61 62 6c 65 20 63 6f | 6c 75 6d 6e 73 20 66 6f |table co|lumns fo|
|00000480| 72 20 61 6c 6c 20 61 72 | 63 68 69 76 65 73 0d 09 |r all ar|chives..|
|00000490| 64 62 4c 6f 6e 67 09 53 | 69 7a 65 3b 20 2f 2f 20 |dbLong.S|ize; // |
|000004a0| 69 6e 20 62 79 74 65 73 | 0d 09 64 62 44 61 74 65 |in bytes|..dbDate|
|000004b0| 09 44 61 74 65 3b 0d 09 | 64 62 43 68 61 72 09 46 |.Date;..|dbChar.F|
|000004c0| 69 6c 65 4e 61 6d 65 3b | 0d 09 64 62 53 6f 72 74 |ileName;|..dbSort|
|000004d0| 65 72 20 61 72 63 53 6f | 72 74 3b 0d 09 0d 09 64 |er arcSo|rt;....d|
|000004e0| 62 41 72 63 68 69 76 65 | 28 29 20 3a 20 0d 09 09 |bArchive|() : ...|
|000004f0| 53 69 7a 65 28 22 53 69 | 7a 65 22 2c 20 6b 49 6e |Size("Si|ze", kIn|
|00000500| 64 65 78 65 64 29 2c 0d | 09 09 44 61 74 65 28 22 |dexed),.|..Date("|
|00000510| 44 61 74 65 20 43 72 65 | 61 74 65 64 22 29 2c 0d |Date Cre|ated"),.|
|00000520| 09 09 46 69 6c 65 4e 61 | 6d 65 28 38 30 2c 20 22 |..FileNa|me(80, "|
|00000530| 46 69 6c 65 20 4e 61 6d | 65 22 2c 20 6b 49 6e 64 |File Nam|e", kInd|
|00000540| 65 78 43 6f 6d 70 72 65 | 73 73 29 0d 09 7b 0d 09 |exCompre|ss)..{..|
|00000550| 09 61 72 63 53 6f 72 74 | 20 3e 3e 20 44 61 74 65 |.arcSort| >> Date|
|00000560| 20 3c 3c 20 46 69 6c 65 | 4e 61 6d 65 3b 0d 09 7d | << File|Name;..}|
|00000570| 3b 0d 09 76 6f 69 64 20 | 41 64 64 54 65 73 74 44 |;..void |AddTestD|
|00000580| 61 74 61 28 29 3b 0d 7d | 3b 0d 0d 76 6f 69 64 0d |ata();.}|;..void.|
|00000590| 64 62 41 72 63 68 69 76 | 65 3a 3a 41 64 64 54 65 |dbArchiv|e::AddTe|
|000005a0| 73 74 44 61 74 61 28 29 | 20 7b 0d 09 64 62 44 61 |stData()| {..dbDa|
|000005b0| 74 65 3a 3a 73 44 65 66 | 61 75 6c 74 44 61 74 65 |te::sDef|aultDate|
|000005c0| 4f 72 64 65 72 20 3d 20 | 64 62 44 61 74 65 3a 3a |Order = |dbDate::|
|000005d0| 6f 72 64 65 72 4d 44 59 | 3b 0d 09 0d 09 6f 73 74 |orderMDY|;....ost|
|000005e0| 72 73 74 72 65 61 6d 20 | 6f 73 73 3b 0d 09 6f 73 |rstream |oss;..os|
|000005f0| 73 20 3c 3c 20 22 31 35 | 33 33 35 37 5c 74 4d 61 |s << "15|3357\tMa|
|00000600| 72 20 31 35 20 31 39 39 | 36 5c 74 61 72 74 2f 7a |r 15 199|6\tart/z|
|00000610| 69 6e 65 2f 72 65 61 6c | 2d 6d 61 63 6f 79 2d 31 |ine/real|-macoy-1|
|00000620| 31 2e 68 71 78 22 20 3c | 3c 20 65 6e 64 6c 0d 09 |1.hqx" <|< endl..|
|00000630| 09 3c 3c 20 22 32 38 38 | 33 38 37 5c 74 4d 61 72 |.<< "288|387\tMar|
|00000640| 20 31 35 20 31 39 39 36 | 5c 74 61 72 74 2f 7a 69 | 15 1996|\tart/zi|
|00000650| 6e 65 2f 72 65 61 6c 2d | 6d 61 63 6f 79 2d 31 32 |ne/real-|macoy-12|
|00000660| 2e 68 71 78 22 20 3c 3c | 20 65 6e 64 6c 0d 09 09 |.hqx" <<| endl...|
|00000670| 3c 3c 20 22 32 30 35 30 | 31 38 5c 74 4d 61 72 20 |<< "2050|18\tMar |
|00000680| 31 35 20 31 39 39 36 5c | 74 61 72 74 2f 7a 69 6e |15 1996\|tart/zin|
|00000690| 65 2f 72 65 61 6c 2d 6d | 61 63 6f 79 2d 31 33 2e |e/real-m|acoy-13.|
|000006a0| 68 71 78 22 20 3c 3c 20 | 65 6e 64 6c 0d 09 09 3c |hqx" << |endl...<|
|000006b0| 3c 20 22 34 34 38 34 35 | 39 5c 74 4d 61 72 20 31 |< "44845|9\tMar 1|
|000006c0| 35 20 31 39 39 36 5c 74 | 61 72 74 2f 7a 69 6e 65 |5 1996\t|art/zine|
|000006d0| 2f 72 65 61 6c 2d 6d 61 | 63 6f 79 2d 31 34 2e 68 |/real-ma|coy-14.h|
|000006e0| 71 78 22 20 3c 3c 20 65 | 6e 64 6c 0d 09 09 3c 3c |qx" << e|ndl...<<|
|000006f0| 20 22 36 30 39 36 5c 74 | 4d 61 72 20 31 36 20 31 | "6096\t|Mar 16 1|
|00000700| 39 39 36 5c 74 64 65 76 | 2f 63 77 20 4c 4d 6f 75 |996\tdev|/cw LMou|
|00000710| 73 65 72 2e 68 71 78 22 | 20 3c 3c 20 65 6e 64 6c |ser.hqx"| << endl|
|00000720| 0d 09 09 3c 3c 20 22 31 | 39 30 35 36 31 5c 74 4d |...<< "1|90561\tM|
|00000730| 61 72 20 31 36 20 31 39 | 39 36 5c 74 64 65 76 2f |ar 16 19|96\tdev/|
|00000740| 63 77 20 63 77 2d 70 61 | 73 63 61 6c 2d 74 63 6c |cw cw-pa|scal-tcl|
|00000750| 2d 70 6f 72 74 2d 31 30 | 2e 68 71 78 22 20 3c 3c |-port-10|.hqx" <<|
|00000760| 20 65 6e 64 6c 3b 0d 09 | 69 73 74 72 65 61 6d 20 | endl;..|istream |
|00000770| 69 73 28 6f 73 73 2e 72 | 64 62 75 66 28 29 29 3b |is(oss.r|dbuf());|
|00000780| 0d 09 69 73 20 3e 3e 20 | 2a 74 68 69 73 3b 0d 7d |..is >> |*this;.}|
|00000790| 0d 0d 2f 2f 20 73 74 61 | 74 69 63 20 73 6f 72 74 |..// sta|tic sort|
|000007a0| 20 6d 65 6d 62 65 72 0d | 09 64 62 53 6f 72 74 65 | member.|.dbSorte|
|000007b0| 72 09 09 20 64 62 54 65 | 73 74 32 31 3a 3a 73 6f |r.. dbTe|st21::so|
|000007c0| 72 74 31 32 33 3b 0d 0d | 69 6e 74 20 6d 61 69 6e |rt123;..|int main|
|000007d0| 28 29 0d 7b 0d 09 63 6f | 75 74 20 3c 3c 20 22 4f |().{..co|ut << "O|
|000007e0| 4f 46 49 4c 45 20 56 61 | 6c 69 64 61 74 69 6f 6e |OFILE Va|lidation|
|000007f0| 20 53 75 69 74 65 20 2d | 20 54 65 73 74 20 32 31 | Suite -| Test 21|
|00000800| 5c 6e 22 0d 09 09 20 3c | 3c 20 22 54 68 69 73 20 |\n"... <|< "This |
|00000810| 74 65 73 74 73 20 74 68 | 65 20 73 74 72 69 6e 67 |tests th|e string|
|00000820| 20 63 6f 6e 74 61 69 6e | 73 20 66 75 6e 63 74 69 | contain|s functi|
|00000830| 6f 6e 73 5c 6e 22 0d 09 | 09 20 3c 3c 20 22 61 6e |ons\n"..|. << "an|
|00000840| 64 20 74 68 65 20 6e 65 | 73 74 65 64 20 73 6f 72 |d the ne|sted sor|
|00000850| 74 73 5c 6e 5c 6e 22 3b | 0d 09 0d 09 54 45 53 54 |ts\n\n";|....TEST|
|00000860| 5f 43 4f 4e 4e 45 43 54 | 20 20 74 68 65 44 42 3b |_CONNECT| theDB;|
|00000870| 0d 09 64 62 54 65 73 74 | 32 31 20 20 20 20 20 09 |..dbTest|21 .|
|00000880| 20 64 62 54 65 73 74 3b | 0d 09 64 62 41 72 63 68 | dbTest;|..dbArch|
|00000890| 69 76 65 09 09 20 41 72 | 63 68 69 76 65 3b 0d 09 |ive.. Ar|chive;..|
|000008a0| 0d 2f 2f 20 69 6e 69 74 | 20 73 74 61 74 69 63 20 |.// init| static |
|000008b0| 73 6f 72 74 09 0d 09 64 | 62 54 65 73 74 32 31 3a |sort...d|bTest21:|
|000008c0| 3a 73 6f 72 74 31 32 33 | 20 3c 3c 20 64 62 54 65 |:sort123| << dbTe|
|000008d0| 73 74 2e 66 31 20 3c 3c | 20 64 62 54 65 73 74 2e |st.f1 <<| dbTest.|
|000008e0| 66 32 20 3c 3c 20 64 62 | 54 65 73 74 2e 66 33 3b |f2 << db|Test.f3;|
|000008f0| 20 20 0d 0d 09 23 69 66 | 64 65 66 20 54 45 53 54 | ...#if|def TEST|
|00000900| 49 4e 47 5f 44 42 41 53 | 45 0d 09 09 23 69 66 64 |ING_DBAS|E...#ifd|
|00000910| 65 66 20 5f 4d 61 63 69 | 6e 74 6f 73 68 0d 09 09 |ef _Maci|ntosh...|
|00000920| 09 63 6f 6e 73 74 20 63 | 68 61 72 2a 20 6b 45 78 |.const c|har* kEx|
|00000930| 69 73 74 73 4e 61 6d 65 | 20 3d 20 20 22 3a 6f 6f |istsName| = ":oo|
|00000940| 66 74 73 74 32 31 3a 64 | 62 54 65 73 74 32 31 2e |ftst21:d|bTest21.|
|00000950| 64 62 66 22 3b 0d 09 09 | 09 63 6f 6e 73 74 20 63 |dbf";...|.const c|
|00000960| 68 61 72 2a 20 6b 44 61 | 74 61 62 61 73 65 4e 61 |har* kDa|tabaseNa|
|00000970| 6d 65 20 3d 20 22 3a 6f | 6f 66 74 73 74 32 31 3a |me = ":o|oftst21:|
|00000980| 22 3b 0d 09 09 23 65 6c | 73 65 0d 09 09 09 63 6f |";...#el|se....co|
|00000990| 6e 73 74 20 63 68 61 72 | 2a 20 6b 45 78 69 73 74 |nst char|* kExist|
|000009a0| 73 4e 61 6d 65 20 3d 20 | 20 20 22 64 62 54 65 73 |sName = | "dbTes|
|000009b0| 74 32 31 2e 64 62 66 22 | 0d 09 09 09 63 6f 6e 73 |t21.dbf"|....cons|
|000009c0| 74 20 63 68 61 72 2a 20 | 6b 44 61 74 61 62 61 73 |t char* |kDatabas|
|000009d0| 65 4e 61 6d 65 20 3d 20 | 22 22 3b 0d 09 09 23 65 |eName = |"";...#e|
|000009e0| 6e 64 69 66 09 0d 0d 09 | 23 65 6c 73 65 0d 09 09 |ndif....|#else...|
|000009f0| 63 6f 6e 73 74 20 63 68 | 61 72 2a 20 6b 44 61 74 |const ch|ar* kDat|
|00000a00| 61 62 61 73 65 4e 61 6d | 65 20 3d 20 22 6f 6f 66 |abaseNam|e = "oof|
|00000a10| 74 73 74 32 31 2e 64 62 | 22 3b 0d 09 09 63 6f 6e |tst21.db|";...con|
|00000a20| 73 74 20 63 68 61 72 2a | 20 6b 45 78 69 73 74 73 |st char*| kExists|
|00000a30| 4e 61 6d 65 20 3d 20 6b | 44 61 74 61 62 61 73 65 |Name = k|Database|
|00000a40| 4e 61 6d 65 3b 0d 09 23 | 65 6e 64 69 66 0d 09 0d |Name;..#|endif...|
|00000a50| 09 69 66 20 28 64 62 43 | 6f 6e 6e 65 63 74 3a 3a |.if (dbC|onnect::|
|00000a60| 66 69 6c 65 45 78 69 73 | 74 73 28 6b 45 78 69 73 |fileExis|ts(kExis|
|00000a70| 74 73 4e 61 6d 65 29 29 | 0d 09 09 74 68 65 44 42 |tsName))|...theDB|
|00000a80| 2e 6f 70 65 6e 43 6f 6e | 6e 65 63 74 69 6f 6e 28 |.openCon|nection(|
|00000a90| 6b 44 61 74 61 62 61 73 | 65 4e 61 6d 65 29 3b 0d |kDatabas|eName);.|
|00000aa0| 09 65 6c 73 65 20 7b 0d | 09 09 74 68 65 44 42 2e |.else {.|..theDB.|
|00000ab0| 6e 65 77 43 6f 6e 6e 65 | 63 74 69 6f 6e 28 6b 44 |newConne|ction(kD|
|00000ac0| 61 74 61 62 61 73 65 4e | 61 6d 65 29 3b 0d 09 09 |atabaseN|ame);...|
|00000ad0| 64 62 54 65 73 74 2e 41 | 64 64 54 65 73 74 44 61 |dbTest.A|ddTestDa|
|00000ae0| 74 61 28 29 3b 0d 09 09 | 41 72 63 68 69 76 65 2e |ta();...|Archive.|
|00000af0| 41 64 64 54 65 73 74 44 | 61 74 61 28 29 3b 0d 09 |AddTestD|ata();..|
|00000b00| 7d 0d 09 63 6f 75 74 20 | 3c 3c 20 22 4c 69 73 74 |}..cout |<< "List|
|00000b10| 69 6e 67 20 41 6c 6c 20 | 52 65 63 6f 72 64 73 22 |ing All |Records"|
|00000b20| 20 3c 3c 20 65 6e 64 6c | 20 3c 3c 20 65 6e 64 6c | << endl| << endl|
|00000b30| 3b 0d 09 63 6f 75 74 20 | 3c 3c 20 64 62 54 65 73 |;..cout |<< dbTes|
|00000b40| 74 3b 0d 09 0d 09 63 6f | 75 74 20 3c 3c 20 65 6e |t;....co|ut << en|
|00000b50| 64 6c 20 3c 3c 20 22 54 | 65 73 74 20 27 43 6f 6e |dl << "T|est 'Con|
|00000b60| 74 61 69 6e 73 20 41 6e | 79 27 20 53 65 61 72 63 |tains An|y' Searc|
|00000b70| 68 20 2d 20 73 65 61 72 | 63 68 69 6e 67 20 66 6f |h - sear|ching fo|
|00000b80| 72 20 27 74 61 27 2c 20 | 27 65 6e 27 20 6f 72 20 |r 'ta', |'en' or |
|00000b90| 27 77 6f 6f 64 27 22 20 | 3c 3c 20 65 6e 64 6c 20 |'wood'" |<< endl |
|00000ba0| 3c 3c 20 65 6e 64 6c 3b | 0d 09 64 62 54 65 73 74 |<< endl;|..dbTest|
|00000bb0| 2e 73 65 61 72 63 68 53 | 65 6c 43 6f 6e 74 61 69 |.searchS|elContai|
|00000bc0| 6e 73 41 6e 79 44 65 6c | 69 6d 69 74 65 64 28 64 |nsAnyDel|imited(d|
|00000bd0| 62 54 65 73 74 2e 66 31 | 2c 20 22 74 61 2c 65 6e |bTest.f1|, "ta,en|
|00000be0| 2c 77 6f 6f 64 22 2c 27 | 2c 27 29 3b 0d 09 63 6f |,wood",'|,');..co|
|00000bf0| 75 74 20 3c 3c 20 64 62 | 54 65 73 74 3b 0d 09 0d |ut << db|Test;...|
|00000c00| 09 63 6f 75 74 20 3c 3c | 20 65 6e 64 6c 20 3c 3c |.cout <<| endl <<|
|00000c10| 20 22 54 65 73 74 20 27 | 43 6f 6e 74 61 69 6e 73 | "Test '|Contains|
|00000c20| 20 41 6c 6c 27 20 53 65 | 61 72 63 68 20 2d 20 73 | All' Se|arch - s|
|00000c30| 65 61 72 63 68 69 6e 67 | 20 66 6f 72 20 27 77 6f |earching| for 'wo|
|00000c40| 6f 64 27 2c 20 27 75 27 | 20 61 6e 64 20 27 64 65 |od', 'u'| and 'de|
|00000c50| 27 22 20 3c 3c 20 65 6e | 64 6c 20 3c 3c 20 65 6e |'" << en|dl << en|
|00000c60| 64 6c 3b 0d 09 64 62 54 | 65 73 74 2e 73 65 61 72 |dl;..dbT|est.sear|
|00000c70| 63 68 53 65 6c 43 6f 6e | 74 61 69 6e 73 41 6c 6c |chSelCon|tainsAll|
|00000c80| 44 65 6c 69 6d 69 74 65 | 64 28 64 62 54 65 73 74 |Delimite|d(dbTest|
|00000c90| 2e 66 31 2c 20 22 77 6f | 6f 64 2c 75 2c 64 65 22 |.f1, "wo|od,u,de"|
|00000ca0| 2c 27 2c 27 29 3b 0d 09 | 63 6f 75 74 20 3c 3c 20 |,',');..|cout << |
|00000cb0| 64 62 54 65 73 74 3b 0d | 09 0d 09 64 62 54 65 73 |dbTest;.|...dbTes|
|00000cc0| 74 2e 73 65 6c 65 63 74 | 41 6c 6c 28 29 3b 0d 09 |t.select|All();..|
|00000cd0| 0d 09 63 6f 75 74 20 3c | 3c 20 65 6e 64 6c 20 3c |..cout <|< endl <|
|00000ce0| 3c 22 54 65 73 74 69 6e | 67 20 4e 65 73 74 65 64 |<"Testin|g Nested|
|00000cf0| 20 73 6f 72 74 20 2d 20 | 73 6f 72 74 69 6e 67 20 | sort - |sorting |
|00000d00| 62 79 20 61 6c 6c 20 66 | 69 65 6c 64 73 2c 20 31 |by all f|ields, 1|
|00000d10| 20 2d 20 32 20 2d 20 33 | 22 20 3c 3c 20 65 6e 64 | - 2 - 3|" << end|
|00000d20| 6c 20 3c 3c 20 65 6e 64 | 6c 3b 0d 09 64 62 54 65 |l << end|l;..dbTe|
|00000d30| 73 74 2e 73 65 74 53 6f | 72 74 4f 72 64 65 72 28 |st.setSo|rtOrder(|
|00000d40| 64 62 54 65 73 74 2e 73 | 6f 72 74 31 32 33 29 3b |dbTest.s|ort123);|
|00000d50| 0d 09 63 6f 75 74 20 3c | 3c 20 64 62 54 65 73 74 |..cout <|< dbTest|
|00000d60| 3b 0d 0d 09 63 6f 75 74 | 20 3c 3c 20 65 6e 64 6c |;...cout| << endl|
|00000d70| 20 3c 3c 22 54 65 73 74 | 69 6e 67 20 4e 65 73 74 | <<"Test|ing Nest|
|00000d80| 65 64 20 73 6f 72 74 20 | 6f 6e 20 31 73 74 20 61 |ed sort |on 1st a|
|00000d90| 6c 6c 20 73 61 6d 65 20 | 76 61 6c 75 65 20 2d 20 |ll same |value - |
|00000da0| 73 6f 72 74 69 6e 67 20 | 62 79 20 61 6c 6c 20 66 |sorting |by all f|
|00000db0| 69 65 6c 64 73 2c 20 31 | 20 2d 20 32 20 2d 20 33 |ields, 1| - 2 - 3|
|00000dc0| 22 20 3c 3c 20 65 6e 64 | 6c 20 3c 3c 20 65 6e 64 |" << end|l << end|
|00000dd0| 6c 3b 0d 09 64 62 54 65 | 73 74 2e 73 65 61 72 63 |l;..dbTe|st.searc|
|00000de0| 68 28 64 62 54 65 73 74 | 2e 66 31 2e 73 74 61 72 |h(dbTest|.f1.star|
|00000df0| 74 73 57 69 74 68 28 22 | 54 61 79 22 29 29 3b 0d |tsWith("|Tay"));.|
|00000e00| 09 63 6f 75 74 20 3c 3c | 20 64 62 54 65 73 74 3b |.cout <<| dbTest;|
|00000e10| 0d 0d 09 64 62 54 65 73 | 74 2e 73 65 6c 65 63 74 |...dbTes|t.select|
|00000e20| 41 6c 6c 28 29 3b 0d 09 | 0d 09 63 6f 75 74 20 3c |All();..|..cout <|
|00000e30| 3c 20 65 6e 64 6c 20 3c | 3c 22 54 65 73 74 69 6e |< endl <|<"Testin|
|00000e40| 67 20 4e 65 73 74 65 64 | 20 73 6f 72 74 20 2d 20 |g Nested| sort - |
|00000e50| 73 6f 72 74 69 6e 67 20 | 62 79 20 61 6c 6c 20 66 |sorting |by all f|
|00000e60| 69 65 6c 64 73 2c 20 32 | 20 2d 20 31 20 2d 20 33 |ields, 2| - 1 - 3|
|00000e70| 22 20 3c 3c 20 65 6e 64 | 6c 20 3c 3c 20 65 6e 64 |" << end|l << end|
|00000e80| 6c 3b 0d 09 64 62 53 6f | 72 74 65 72 20 73 6f 72 |l;..dbSo|rter sor|
|00000e90| 74 32 31 33 3b 0d 09 73 | 6f 72 74 32 31 33 20 3c |t213;..s|ort213 <|
|00000ea0| 3c 20 64 62 54 65 73 74 | 2e 66 32 20 3c 3c 20 64 |< dbTest|.f2 << d|
|00000eb0| 62 54 65 73 74 2e 66 31 | 20 3c 3c 20 64 62 54 65 |bTest.f1| << dbTe|
|00000ec0| 73 74 2e 66 33 3b 0d 09 | 64 62 54 65 73 74 2e 73 |st.f3;..|dbTest.s|
|00000ed0| 65 74 53 6f 72 74 4f 72 | 64 65 72 28 73 6f 72 74 |etSortOr|der(sort|
|00000ee0| 32 31 33 29 3b 0d 09 63 | 6f 75 74 20 3c 3c 20 64 |213);..c|out << d|
|00000ef0| 62 54 65 73 74 3b 0d 0d | 09 63 6f 75 74 20 3c 3c |bTest;..|.cout <<|
|00000f00| 20 65 6e 64 6c 20 3c 3c | 20 22 6e 6f 77 20 72 65 | endl <<| "now re|
|00000f10| 76 65 72 73 69 6e 67 20 | 74 68 65 20 73 65 63 6f |versing |the seco|
|00000f20| 6e 64 20 73 6f 72 74 20 | 69 74 65 6d 20 69 6e 20 |nd sort |item in |
|00000f30| 74 68 65 20 61 62 6f 76 | 65 20 74 65 73 74 22 20 |the abov|e test" |
|00000f40| 3c 3c 20 65 6e 64 6c 20 | 3c 3c 20 65 6e 64 6c 3b |<< endl |<< endl;|
|00000f50| 0d 09 64 62 54 65 73 74 | 2e 73 65 74 53 6f 72 74 |..dbTest|.setSort|
|00000f60| 4f 72 64 65 72 28 64 62 | 53 6f 72 74 65 72 28 29 |Order(db|Sorter()|
|00000f70| 20 3c 3c 20 64 62 54 65 | 73 74 2e 66 32 20 3c 3c | << dbTe|st.f2 <<|
|00000f80| 20 72 65 76 65 72 73 65 | 64 28 64 62 54 65 73 74 | reverse|d(dbTest|
|00000f90| 2e 66 31 29 20 3c 3c 20 | 64 62 54 65 73 74 2e 66 |.f1) << |dbTest.f|
|00000fa0| 33 29 3b 0d 09 63 6f 75 | 74 20 3c 3c 20 64 62 54 |3);..cou|t << dbT|
|00000fb0| 65 73 74 3b 0d 09 0d 09 | 63 6f 75 74 20 3c 3c 20 |est;....|cout << |
|00000fc0| 65 6e 64 6c 20 3c 3c 20 | 22 54 65 73 74 69 6e 67 |endl << |"Testing|
|00000fd0| 20 73 75 73 70 65 6e 64 | 65 64 20 73 6f 72 74 73 | suspend|ed sorts|
|00000fe0| 20 61 6e 64 20 63 6c 6f | 6e 69 6e 67 20 73 65 6c | and clo|ning sel|
|00000ff0| 65 63 74 69 6f 6e 73 20 | 28 66 69 65 6c 64 73 20 |ections |(fields |
|00001000| 31 32 33 29 22 20 3c 3c | 20 65 6e 64 6c 3b 0d 09 |123)" <<| endl;..|
|00001010| 64 62 54 65 73 74 2e 73 | 65 74 53 6f 72 74 4f 72 |dbTest.s|etSortOr|
|00001020| 64 65 72 28 64 62 54 65 | 73 74 2e 73 6f 72 74 31 |der(dbTe|st.sort1|
|00001030| 32 33 29 3b 0d 09 64 62 | 54 65 73 74 2e 73 75 73 |23);..db|Test.sus|
|00001040| 70 65 6e 64 53 6f 72 74 | 69 6e 67 28 29 3b 0d 09 |pendSort|ing();..|
|00001050| 64 62 54 65 73 74 2e 73 | 65 61 72 63 68 28 64 62 |dbTest.s|earch(db|
|00001060| 54 65 73 74 2e 66 31 2e | 73 74 61 72 74 73 57 69 |Test.f1.|startsWi|
|00001070| 74 68 28 22 54 61 79 22 | 29 29 3b 0d 09 63 6f 75 |th("Tay"|));..cou|
|00001080| 74 20 3c 3c 20 22 55 6e | 73 6f 72 74 65 64 2e 2e |t << "Un|sorted..|
|00001090| 2e 22 20 3c 3c 20 65 6e | 64 6c 20 3c 3c 20 64 62 |." << en|dl << db|
|000010a0| 54 65 73 74 20 3c 3c 20 | 65 6e 64 6c 3b 0d 0d 09 |Test << |endl;...|
|000010b0| 64 62 54 65 73 74 32 31 | 20 63 6c 6f 6e 65 64 28 |dbTest21| cloned(|
|000010c0| 64 62 54 65 73 74 29 3b | 20 20 2f 2f 20 73 68 6f |dbTest);| // sho|
|000010d0| 75 6c 64 20 68 61 76 65 | 20 73 61 6d 65 20 73 6f |uld have| same so|
|000010e0| 72 74 20 6f 72 64 65 72 | 2c 20 73 74 69 6c 6c 20 |rt order|, still |
|000010f0| 73 75 73 70 65 6e 64 65 | 64 0d 0d 09 64 62 54 65 |suspende|d...dbTe|
|00001100| 73 74 2e 72 65 73 75 6d | 65 53 6f 72 74 69 6e 67 |st.resum|eSorting|
|00001110| 28 29 3b 0d 09 63 6f 75 | 74 20 3c 3c 20 22 53 6f |();..cou|t << "So|
|00001120| 72 74 65 64 2e 2e 2e 22 | 20 3c 3c 20 65 6e 64 6c |rted..."| << endl|
|00001130| 20 3c 3c 20 64 62 54 65 | 73 74 20 3c 3c 20 65 6e | << dbTe|st << en|
|00001140| 64 6c 3b 0d 09 09 0d 09 | 63 6f 75 74 20 3c 3c 20 |dl;.....|cout << |
|00001150| 22 55 6e 73 6f 72 74 65 | 64 20 63 6c 6f 6e 65 2e |"Unsorte|d clone.|
|00001160| 2e 2e 22 20 3c 3c 20 65 | 6e 64 6c 20 3c 3c 20 63 |.." << e|ndl << c|
|00001170| 6c 6f 6e 65 64 20 3c 3c | 20 65 6e 64 6c 3b 0d 09 |loned <<| endl;..|
|00001180| 63 6c 6f 6e 65 64 2e 72 | 65 73 75 6d 65 53 6f 72 |cloned.r|esumeSor|
|00001190| 74 69 6e 67 28 29 3b 0d | 09 63 6f 75 74 20 3c 3c |ting();.|.cout <<|
|000011a0| 20 22 53 6f 72 74 65 64 | 20 63 6c 6f 6e 65 2e 2e | "Sorted| clone..|
|000011b0| 2e 22 20 3c 3c 20 65 6e | 64 6c 20 3c 3c 20 63 6c |." << en|dl << cl|
|000011c0| 6f 6e 65 64 20 3c 3c 20 | 65 6e 64 6c 3b 0d 09 0d |oned << |endl;...|
|000011d0| 0d 09 63 6f 75 74 20 3c | 3c 20 22 4e 6f 77 20 74 |..cout <|< "Now t|
|000011e0| 65 73 74 69 6e 67 20 73 | 6f 6d 65 20 61 64 64 69 |esting s|ome addi|
|000011f0| 74 69 6f 6e 61 6c 20 6d | 75 6c 74 69 70 6c 65 20 |tional m|ultiple |
|00001200| 66 69 65 6c 64 20 73 6f | 72 74 20 62 75 67 73 22 |field so|rt bugs"|
|00001210| 20 3c 3c 20 65 6e 64 6c | 3b 0d 09 63 6f 75 74 20 | << endl|;..cout |
|00001220| 3c 3c 20 22 55 6e 73 6f | 72 74 65 64 22 20 3c 3c |<< "Unso|rted" <<|
|00001230| 20 65 6e 64 6c 20 3c 3c | 20 41 72 63 68 69 76 65 | endl <<| Archive|
|00001240| 20 3c 3c 20 65 6e 64 6c | 3b 0d 09 0d 09 41 72 63 | << endl|;....Arc|
|00001250| 68 69 76 65 2e 73 65 74 | 53 6f 72 74 4f 72 64 65 |hive.set|SortOrde|
|00001260| 72 28 41 72 63 68 69 76 | 65 2e 61 72 63 53 6f 72 |r(Archiv|e.arcSor|
|00001270| 74 29 3b 0d 09 63 6f 75 | 74 20 3c 3c 20 22 3e 3e |t);..cou|t << ">>|
|00001280| 20 44 61 74 65 20 3c 3c | 20 46 69 6c 65 4e 61 6d | Date <<| FileNam|
|00001290| 65 22 20 3c 3c 20 65 6e | 64 6c 20 3c 3c 20 41 72 |e" << en|dl << Ar|
|000012a0| 63 68 69 76 65 20 3c 3c | 20 65 6e 64 6c 3b 0d 0d |chive <<| endl;..|
|000012b0| 09 63 6f 75 74 20 3c 3c | 20 65 6e 64 6c 20 3c 3c |.cout <<| endl <<|
|000012c0| 22 54 65 73 74 20 43 6f | 6d 70 6c 65 74 65 64 22 |"Test Co|mpleted"|
|000012d0| 20 3c 3c 20 65 6e 64 6c | 3b 0d 09 0d 09 72 65 74 | << endl|;....ret|
|000012e0| 75 72 6e 20 45 58 49 54 | 5f 53 55 43 43 45 53 53 |urn EXIT|_SUCCESS|
|000012f0| 3b 0d 7d 20 0d 00 00 00 | 00 00 00 00 00 00 00 00 |;.} ....|........|
|00001300| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001310| 20 52 61 6e 64 6f 6d 69 | 7a 65 72 20 31 2e 30 00 | Randomi|zer 1.0.|
|00001320| 00 00 00 00 00 00 00 00 | 00 00 00 04 00 00 13 7d |........|.......}|
|00001330| 0c 6f 6f 66 74 73 74 32 | 31 2e 63 70 70 32 02 00 |.ooftst2|1.cpp2..|
|00001340| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001350| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 b0 1b 75 fd 00 00 | 00 00 00 00 01 9a 00 00 |....u...|........|
|00001380| 00 00 00 02 00 00 01 85 | ad 66 1e a4 0b 4e 65 77 |........|.f...New|
|00001390| 73 57 61 74 63 68 65 72 | 00 00 00 00 00 00 00 00 |sWatcher|........|
|000013a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 04 |........|........|
|000013b0| 00 00 0a 58 ad 66 33 2c | 00 00 00 00 00 00 00 00 |...X.f3,|........|
|000013c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001400| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 00 00 00 00 00 00 00 03 | 00 04 00 a6 00 14 02 6c |........|.......l|
|00001430| 02 94 00 a6 00 14 02 6c | 02 94 af 68 71 83 00 00 |.......l|...hq...|
|00001440| 00 00 00 00 00 00 00 00 | 05 6d 01 00 00 00 00 04 |........|.m......|
|00001450| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00001460| 00 00 00 46 01 a3 eb 60 | 2c ce 00 00 00 1c 00 46 |...F...`|,......F|
|00001470| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00001480| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00001490| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000014a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+